#ifndef GTKMM_ITEMWINDOW_H
#define GTKMM_ITEMWINDOW_H

#include <gtkmm.h>

#define LIST_LOG_LOCATE ".list.log"
#define LIST_TMP_LOCATE ".list.tmp"

static unsigned int index_count;
static unsigned int item_n_count;

class CellItem_Product
{
	public:
		CellItem_Product();
		CellItem_Product(const CellItem_Product& src);
		~CellItem_Product();
		CellItem_Product& operator=(const CellItem_Product& src);

	  int m_col_id;
	  Glib::ustring m_col_name;
};

class ItemWindow : public Gtk::Window
{
	public:
		ItemWindow();
		virtual ~ItemWindow();

	protected:
		virtual void on_button_quit();
		virtual void on_button_add_clicked(/* Glib::ustring getValue */); /// Add item to ListStore Widget
		virtual void on_button_remove_clicked(/* Glib::ustring getValue */); /// Remove item from ListStore Widget
		virtual void on_button_print_clicked(/* Glib::ustring getValue */); /// Print item at ListStore Widget
		virtual void file_add_item(const CellItem_Product& foo);
		virtual void file_remove_item(unsigned int index);
		virtual void liststore_add_item(const CellItem_Product& foo);

		class ModelColumns: public Gtk::TreeModel::ColumnRecord
		{
			public:

				ModelColumns()
				{ add(col_id); add(col_name);}

//				Gtk::TreeModelColumn<unsigned int> m_col_id;
//				Gtk::TreeModelColumn<Glib::ustring>	m_col_name;
		 		Gtk::TreeModelColumn<unsigned int>    col_id;
			  	Gtk::TreeModelColumn<Glib::ustring> col_name;

		};


		typedef std::vector<CellItem_Product> type_vecItems;
		type_vecItems m_vecItems;

		ModelColumns m_Columns;

		Gtk::VBox m_VBox;
		Gtk::HBox m_HBox;

		Gtk::ScrolledWindow m_ScrolledWindow;
		Gtk::TreeView m_TreeView;
		Glib::RefPtr<Gtk::ListStore> m_refTreeModel;

		/// Entry
		Gtk::Entry m_Entry;
		Gtk::Button m_Button_AddItem, m_Button_RemoveItem, m_Button_PrintItem;

		Gtk::HButtonBox m_ButtonBox;
		Gtk::Button m_Button_Quit;

};

#endif
